package Day29.bulider;

import java.util.ArrayList;

public class Director {
    private ArrayList<String> sequence = new ArrayList<>();
    private BenzBuilder benzBuilder = new BenzBuilder();
    private BaozBuilder baozBuilder = new BaozBuilder();

    /**
     * 奔驰模型A，先启动在停止
     * @return
     */
    public Benz getABenz(){
        this.sequence.clear();
        this.sequence.add("start");
        this.sequence.add("stop");
        this.benzBuilder.setSequence(sequence);
        return (Benz) this.benzBuilder.getCarModel();
    }

    /**
     * 奔驰模型B，先发动引擎在start再停止
     * @return
     */
    public Benz getBBenz(){
        this.sequence.clear();
        this.sequence.add("engineBoom");
        this.sequence.add("start");
        this.sequence.add("stop");
        this.benzBuilder.setSequence(sequence);
        return (Benz) this.benzBuilder.getCarModel();
    }

    /**
     * 宝马模型C，先鸣笛再starr在停止
     * @return
     */
    public Baoz getCBaoz(){
        this.sequence.clear();
        this.sequence.add("start");
        this.sequence.add("engineBoom");
        this.sequence.add("alarm");
        this.sequence.add("stop");
        this.baozBuilder.setSequence(sequence);
        return (Baoz) this.baozBuilder.getCarModel();
    }

    //自行定义其他模型
}
